/*
 * @Author: c
 * @Date: 2024-01-08 22:24:31
 * @LastEditTime: 2024-03-16 20:50:39
 * @LastEditors: c
 * @Description: 
 * @FilePath: \music-web-backend\src\core\music\home\home.controller.ts
 * https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Body, Controller, Delete, Get, Param, Patch, Post, Req } from '@nestjs/common';
import { SkipAuth } from 'src/core/system/auth/constants';
import { CreateHomeDto } from './dto/create-home.dto';
import { UpdateHomeDto } from './dto/update-home.dto';
import { HomeService } from './home.service';


@Controller('index')
export class HomeController {
  constructor(private readonly homeService: HomeService) { }

  @Post()
  create(@Body() createHomeDto: CreateHomeDto) {
    return this.homeService.create(createHomeDto);
  }

  @SkipAuth()
  @Get()
  findAll(@Req() req: any) {
    return this.homeService.findAll(req.user);
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.homeService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateHomeDto: UpdateHomeDto) {
    return this.homeService.update(+id, updateHomeDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.homeService.remove(+id);
  }
}
